package com.smart.face.controller;

import com.smart.face.service.FaceService;
import org.springframework.web.bind.annotation.PostMapping;
import com.smart.face.service.FaceService;
import org.json.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.Map;
import org.springframework.web.bind.annotation.RestController;



/**
 * 作者: JinMenglong
 * 描述:
 * 日期: Create in 2021-01-08 16:25
 * 修改人:
 * 最后一次修改时间:
 */
@RestController
@RequestMapping("/face")
public class FaceController {
    @Resource
    private FaceService faceService;

    @PostMapping("/search")
    public Map<String, Object> faceSearch(MultipartFile file) throws IOException {
        return faceService.search(file);
    }

    /**
     * 人脸检测
     * @param faceMap
     * @return
     */
    @PostMapping("/faceDetect")
    public Map<String,Object> faceDetect(@RequestBody Map faceMap) {
        return faceService.faceDetect(faceMap);
    }

}
